﻿using System;
using System.Collections.Generic;
using Dimebrain.TweetSharp.Core.Extensions;
using Dimebrain.TweetSharp.Model;

namespace Dimebrain.TweetSharp.Extensions
{
    partial class TwitterExtensions
    {
        public static IEnumerable<TwitterUser> Since(this IEnumerable<TwitterUser> users, DateTime date)
        {
            return users.Filter(u => u.CreatedDate.After(date));
        }

        public static IEnumerable<TwitterUser> Before(this IEnumerable<TwitterUser> users, DateTime date)
        {
            return users.Filter(u => u.CreatedDate.Before(date));
        }

        public static IEnumerable<TwitterStatus> Since(this IEnumerable<TwitterStatus> users, DateTime date)
        {
            return users.Filter(u => u.CreatedDate.After(date));
        }

        public static IEnumerable<TwitterStatus> Before(this IEnumerable<TwitterStatus> users, DateTime date)
        {
            return users.Filter(u => u.CreatedDate.Before(date));
        }

        public static IEnumerable<TwitterDirectMessage> Since(this IEnumerable<TwitterDirectMessage> users, DateTime date)
        {
            return users.Filter(u => u.CreatedDate.After(date));
        }

        public static IEnumerable<TwitterDirectMessage> Before(this IEnumerable<TwitterDirectMessage> users, DateTime date)
        {
            return users.Filter(u => u.CreatedDate.Before(date));
        }
    }
}
